﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>

<title></title>
</head>
<body>
<div class="ibox-content">
	<form class="form-horizontal" id="dataform"
		onsubmit="javascripr:return false;">

		<input type="hidden" name="tokenUrl" value="${tokenUrl}"> 
		<input type="hidden" name="token" value="${token}">

		<c:if test="${obj ne null }">
			<input type="hidden" name="uId" value='<c:out value="${obj.uId}"></c:out>'>
		</c:if>
		
		<div class="form-group">
			<label class="col-sm-2 control-label ">姓名 <span class="red">*</span></label>
			<div class="col-sm-4">
				<input type="text" name="uName" value='<c:out value="${obj.uName}"></c:out>'
					class="form-control radius" datatype="*1-20" nullmsg="姓名不能为空">			
				<div class="Validform_checktip"></div>
			</div>
			
			<label class="col-sm-2 control-label">手机号 <span class="red">*</span></label>
			<div class="col-sm-4">
				<input type="text"  class="form-control" datatype="m"
					value='<c:out value="${obj.uPhone}"></c:out>' 
					name="uPhone" nullmsg="电话不能为空">
				<div class="Validform_checktip"></div>					
			</div>
		</div>

		<div class="form-group">			
			<label class="col-sm-2 control-label">所属部门 <span class="red">*</span></label>
			<div class="  col-sm-4">
				<select name="uDepartment" class="form-control autoFull select2"
					data-url="${path}/admin/userinfo/queryAllDepart"
					data-def="${obj.uDepartment }"
					data-filed="name" data-value="name"
					datatype="*" nullmsg="部门不能为空">
					<option value="">--请选择所属部门--</option>
				</select>
				<div class="Validform_checktip"></div>				
			</div>
			
			<label class="col-sm-2 control-label">担任职位 <span class="red">*</span></label>
			<div class="col-sm-4">
				<select name="uJob" class="form-control autoFull select2"
					data-url="${path}/admin/userinfo/queryAllPostion"
					data-def="${obj.uJob }"
					data-filed="name" data-value="name"
					datatype="*" nullmsg="职位不能为空">
					<option value="">--请选择职位--</option>
				</select>
				<div class="Validform_checktip"></div>									
			</div>			
		</div>
		
		<div class="form-group">			
			<label class="col-sm-2 control-label  ">性别 <span class="red">*</span></label>
			<div class="  col-sm-4">
				<select class="form-control" size="1" name="uSex" 
					datatype="*" nullmsg="性别不能为空">
					<option value=" ">-- 请选择性别 --</option>
					<option <c:if test="${obj.uSex eq '女'}"> selected="selected" </c:if>
							value='女'>女</option>
					<option  <c:if test="${obj.uSex eq '男'}"> selected="selected" </c:if>
							value='男'>男</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
			<label class="col-sm-2 control-label">入职时间 <span class="red">*</span></label>
			<div class="col-sm-4">
				<input type="text"  class="form-control  datetimepicker"  
					name="uJobdate" 
					value='<fmt:formatDate value="${obj.uJobdate}" pattern="yyyy-MM-dd"/>' 
					datatype="*" nullmsg="入职时间不能为空"
					>
				<div class="Validform_checktip"></div>
			</div>
		</div>
		
		<div class="form-group ">
			<div class="col-sm-12 text-center">
				<a href="javascript:;" onclick="myForm.submit()" class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">取消</button>
			</div>
		</div>
	</form>
</div>
</body>
<script type="text/javascript">
	var myForm;
	$(function(){
		//带搜索的下拉框
		$(".select2").select2({'width':'100%'});
		$(".select2").trigger("blur");
		//初始化下拉框
		MTools.autoFullSelect();
		//初始化日期控件
		MTools.ininDatetimepicker({
			listenBlur : true
		}); 
		//表格提交
		myForm = MForm.initForm({
			invokeUrl : "${path}/admin/userinfo/addOrModify",
			afterSubmit : function() {
				parent.myGrid.serchData();
			},
		});
		
	});
	
	$('.select2').change(function() {
		if(this.value != "") {
			$(this).parent().children('.Validform_checktip').text('');
			$(this).parent().children('.Validform_checktip').removeClass('Validform_wrong');
			$(this).parent().children('.Validform_checktip').addClass('Validform_right');
		}
	})

</script>
</body>
</html>